home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWPresen.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  5.4 KB  |  176 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPresen.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPRESEN_H
  11. #define FWPRESEN_H
  12.  
  13. // ----- OS Layer -----
  14.  
  15. #ifndef FWRECT_H
  16. #include "FWRect.h"
  17. #endif
  18.  
  19. // ----- Foundation Includes -----
  20.  
  21. #ifndef FWRUNTYP_H
  22. #include "FWRunTyp.h"
  23. #endif
  24.  
  25. // ----- OpenDoc -----
  26.  
  27. #ifndef _ODTYPES_
  28. #include <ODTypes.h>
  29. #endif
  30.  
  31. #if FW_LIB_EXPORT_PRAGMAS
  32. #pragma lib_export on
  33. #endif
  34.  
  35. //========================================================================================
  36. //    Forward Declarations
  37. //========================================================================================
  38.  
  39. class FW_CLASS_ATTR ODShape;
  40. class FW_CLASS_ATTR ODPart;
  41. class FW_CLASS_ATTR ODFrame;
  42. class FW_CLASS_ATTR ODFacet;
  43.  
  44. class FW_CLASS_ATTR FW_CPart;
  45. class FW_CLASS_ATTR FW_CSelection;
  46. class FW_CLASS_ATTR FW_CPrivOrderedCollection;
  47. class FW_CLASS_ATTR FW_CFrame;
  48. class FW_CLASS_ATTR FW_MProxy;
  49. class FW_CLASS_ATTR FW_CViewAs;
  50. class FW_CLASS_ATTR FW_CViewAsThumbnail;
  51. class FW_CLASS_ATTR FW_CViewAsSmallIcon;
  52. class FW_CLASS_ATTR FW_CViewAsLargeIcon;
  53.  
  54. //========================================================================================
  55. //    class FW_CPresentation
  56. //========================================================================================
  57.  
  58. class FW_CLASS_ATTR FW_CPresentation
  59. {
  60. public:
  61.     FW_DECLARE_CLASS
  62.  
  63.     friend class FW_CLASS_ATTR FW_CPresentationFrameIterator;
  64.     
  65. //----------------------------------------------------------------------------------------
  66. //    Constructors/Destructors
  67. //
  68. public:
  69.     FW_CPresentation(Environment *ev, 
  70.                     FW_CPart* thePart, 
  71.                     FW_CSelection* selection, 
  72.                     ODTypeToken presentationType,
  73.                     FW_Boolean sameViewTypeForEmbeddedFrames = TRUE);
  74.     virtual ~FW_CPresentation();
  75.  
  76. //----------------------------------------------------------------------------------------
  77. //    New API
  78. //
  79. public:
  80.     // ----- Invalidate/Validate -----
  81.     void                Invalidate(Environment *ev, ODShape* invalidShape = NULL, ODFacet* skipFacet = NULL);
  82.     void                Validate(Environment *ev, ODShape* validShape = NULL, ODFacet* skipFacet = NULL);
  83.         
  84.     void                Invalidate(Environment* ev, const FW_CRect& invalidRect, ODFacet* skipFacet = NULL);
  85.     void                Validate(Environment* ev, const FW_CRect& validRect, ODFacet* skipFacet = NULL);
  86.  
  87.     // ----- Getters -----
  88.     FW_CSelection*        GetSelection(Environment* ev) const;
  89.     FW_CPart*            GetPart(Environment* ev) const;
  90.     ODTypeToken            GetPresentationType(Environment* ev) const;
  91.  
  92.     unsigned long        CountFrame(Environment* ev) const;
  93.     
  94.     // ----- Embedding -----
  95.     virtual void        Embed(Environment *ev, 
  96.                             ODPart *odEmbeddedPart,
  97.                             ODFrame* odEmbeddedFrame,        // Can be null
  98.                             FW_MProxy* proxy,
  99.                             ODShape* frameShape,
  100.                             ODTypeToken viewType,
  101.                             ODTypeToken presentationType,
  102.                             ODID frameGroupID,
  103.                             FW_Boolean subFrame);
  104.     
  105.     // ----- View In Window Frame -----
  106.     ODID                ViewInWindow(Environment* ev, FW_CFrame* sourceFrame, ODFacet* sourceFacet);
  107.     
  108.     // ----- View As -----
  109.     FW_CViewAs*            AcquireViewAs(Environment* ev, FW_CFrame* frame, ODTypeToken viewAs);    
  110.     void                ReleaseViewAs(Environment* ev, FW_CViewAs* viewAs);
  111.     
  112.     // ----- Show Part Info -----
  113.     FW_Boolean            UseSameViewTypeForEmbeddedFrames(Environment* ev) const;
  114.  
  115. //----------------------------------------------------------------------------------------
  116. //    Internal Use Only
  117. //
  118. public:
  119.     void                PrivAddFrame(Environment *ev, FW_CFrame* frame);
  120.     void                PrivRemoveFrame(Environment *ev, FW_CFrame* frame);
  121.     
  122. //----------------------------------------------------------------------------------------
  123. //    Data Members
  124. //
  125. private:
  126.     FW_CPart*                        fPart;
  127.     FW_CSelection*                    fSelection;
  128.     FW_CPrivOrderedCollection*         fFrames;
  129.     ODTypeToken                        fPresentationType;
  130.     
  131.     FW_CViewAsThumbnail*            fViewAsThumbnail;
  132.     FW_CViewAsSmallIcon*            fViewAsSmallIcon;
  133.     FW_CViewAsLargeIcon*            fViewAsLargeIcon;
  134.     
  135.     FW_CFrame*                        fViewInWindowFrame;
  136.     
  137.     FW_Boolean                        fSameViewTypeForEmbeddedFrames;
  138. };
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    FW_CPresentation::GetSelection
  142. //----------------------------------------------------------------------------------------
  143. inline FW_CSelection* FW_CPresentation::GetSelection(Environment*) const
  144. {
  145.     return fSelection;
  146. }
  147.  
  148. //----------------------------------------------------------------------------------------
  149. //    FW_CPresentation::GetSelection
  150. //----------------------------------------------------------------------------------------
  151. inline FW_CPart* FW_CPresentation::GetPart(Environment*) const
  152. {
  153.     return fPart;
  154. }
  155.  
  156. //----------------------------------------------------------------------------------------
  157. //    FW_CPresentation::GetPresentationType
  158. //----------------------------------------------------------------------------------------
  159. inline ODTypeToken FW_CPresentation::GetPresentationType(Environment*) const
  160. {
  161.     return fPresentationType;
  162. }
  163.  
  164. //----------------------------------------------------------------------------------------
  165. //    FW_CPresentation::UseSameViewTypeForEmbeddedFrames
  166. //----------------------------------------------------------------------------------------
  167. inline FW_Boolean FW_CPresentation::UseSameViewTypeForEmbeddedFrames(Environment*) const
  168. {
  169.     return fSameViewTypeForEmbeddedFrames;
  170. }
  171.  
  172. #if FW_LIB_EXPORT_PRAGMAS
  173. #pragma lib_export off
  174. #endif
  175.  
  176. #endif